﻿using Quartz;
using System;
using System.Threading.Tasks;

namespace DataProcess.Core.Quartz.Jobs
{
    public class BaseJob : IJob
    {
        protected Action ExecuteAct { get; set; }

#if NET40
        public void Execute(IJobExecutionContext context)
        {
            ExecuteAct?.Invoke();
        }
#elif NET48 || NETSTANDARD
        public Task Execute(IJobExecutionContext context)
        {
            ExecuteAct?.Invoke();
            return Task.CompletedTask;
        }
#endif
    }
}
